*cd "C:\Research\Emiss_Trade_price_controls\data\"
cd "/Users/cason/Dropbox/Research/Emiss_Trade_price_controls/data/"

use Subjects_11sessions.dta

** Drop practice period **
drop if Period<1

** Abatement undertaken **
gen abatement = max(0, ASAQ-Purchased+Sold)

** Emissions are the unregulated amount, adjusted for the investment and shock, and abatement **
gen emissions = ASAQ + 23 - abatement

** Now aggregate across all 8 firms **
collapse (sum) emissions, by(pri_control sess_num Period)

sum emissions, detail
by pri_control, sort : summarize emissions
by pri_control, sort : summarize emissions if Period>5

by pri_control, sort : tabstat emissions, statistics( mean semean ) by(Period)

** Conduct statistical tests for Periods 6-16 **
drop if Period<6
collapse (mean) emissions, by(pri_control sess_num)

ranksum emissions, by(pri_control)

